#
# Makefile for Vlang
# Author: Wang Fuying <805447391@qq.com>
# Date: 2019-7-12 18:14:10
#


include $(TOPDIR)/rules.mk

PKG_NAME:=vlang
PKG_VERSION:=0.1.12
PKG_RELEASE:=1

PKG_SOURCE:=v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/vlang/v/archive/
PKG_BUILD_DIR:=$(BUILD_DIR)/v-$(PKG_VERSION)
PKG_HASH:=8ef63f32f649c197042167500f8cc1d3a722a29274518816b6140fd0dd024e8e

include $(INCLUDE_DIR)/package.mk

define Package/vlang
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=The V Programming Language
  URL:=https://vlang.io/
  DEPENDS:=+gcc
endef

define Package/vlang/description
  Simple, fast, safe, compiled language for developing maintainable software
endef

define Package/vlang/install
  $(INSTALL_DIR) $(1)/usr/share/v
	$(CP) $(PKG_BUILD_DIR)/compiler $(1)/usr/share/v
	$(CP) $(PKG_BUILD_DIR)/examples $(1)/usr/share/v
	$(CP) $(PKG_BUILD_DIR)/thirdparty $(1)/usr/share/v
	$(CP) $(PKG_BUILD_DIR)/vlib $(1)/usr/share/v

	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/v $(1)/usr/share/v
	$(LN) ../share/v/v $(1)/usr/bin/v
endef

$(eval $(call BuildPackage,vlang))
